package day03;

public class OperDemo {
    public static void main(String[] args) {
        /*
        int a=5,b=5;
        int c=a++;
        int d=++b;
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);*/

        /*
        int a=5,b=5;
        System.out.println(a++);
        System.out.println(++b);
        System.out.println(a);
        System.out.println(b);*/

        /*
        int a=5,b=5;
        int c=a--,d=--b;
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);*/

        //关系运算符

        /*
        int a=5,b=10,c=5;
        boolean b1=a>b;
        System.out.println(b1);//false
        System.out.println(c<b);//true
        System.out.println(a>=c);//true
        System.out.println(a<=b);//true
        System.out.println(a==c);//true
        System.out.println(a!=c);//false
        System.out.println(a%2==0);//false
        System.out.println(a+c>b);//false
        System.out.println(a++>5);//false
        System.out.println(a++>5);//true    */

        //逻辑运算符
        /*
        int a=5,b=10,c=5;
        boolean b1 = b>=a && b<c;//false
        System.out.println(b1);//
        System.out.println(b<=c && b>a);//false
        System.out.println(a==b && b<a);//false
        System.out.println(b!=c && b>a);//true

        int age=39;
        System.out.println(age>=18 && age<=50);//true
        int score=89;
        System.out.println(score>=0 && score<=100);//true   */

        /*
        int a=5,b=10,c=5;
        System.out.println(b>=a || b<c);//true
        System.out.println(b<=c || b>a);//true
        System.out.println(b!=c || b>a);//true
        System.out.println(a==b || b<a);//false
        int score=90;
        System.out.println(score<0 ||score>100);//false  */

        /*
        int a=5,b=10,c=5;
        boolean b3=a>b && c++>5;
        System.out.println(b3);
        System.out.println(c);//短路与 */

        //赋值运算符(自带强转）
        /*
        int a=5;
        a+=10;
        System.out.println(a);//15
        a*=2;
        System.out.println(a);//30
        a/=6;
        System.out.println(a);//5

        short s=5;
        s+=10;//相当于s=（short）(s+10)
        //s=s+10; 编译错误需强转
        System.out.println(s);//15 */

        /*
        int age=39;
        System.out.println("age=");//age=
        System.out.println(age);//39
        System.out.println("age="+age);//age=39
        System.out.println("我今年"+age+"岁了");

        String name="W";
        System.out.println("大家好，我叫"+name);
        System.out.println("大家好，我叫"+name+"我今年"+age+"岁了");
        System.out.println(10+20+"21"+30);//302130
        System.out.println("99"+10+20+30);//99102030
        System.out.println(10+20+30+"兔");//60兔            */

        /*
        int b='a';//看苻对应的码
        System.out.println(b);
        char c=100;//看码对应的苻
        System.out.println(c);  */

        //找两个数中的最大值
        /*
        int a=9,b=100;
        int max= a<b?b:a;
        System.out.println(max);
        int c=a>b?a:b;
        System.out.println(c);*/
    }
}
